<template>
	<div :class="['yl-radio', value ? 'active' : '']" @click="tap"><uni-icons v-if="value" style="display: flex;" type="checkmarkempty" color="#FFFFFF" size="16"></uni-icons></div>
</template>

<script>
export default {
	name: 'ylRadio',
	props: {
		value: {
			type: Boolean,
			default: true
		},
		disable: {
			type: Boolean,
			default: false
		}
	},
	model: {
		prop: 'value',
		event: 'input'
	},
	data() {
		return {
			checkStyle: {
				backgroundColor: '#FCA118',
				borderColor: '#FCA118'
			}
		};
	},
	methods: {
		tap() {
			this.$emit('tapRadio', this.value);
			if (this.disable) {
				return;
			}
			//this.value = !this.value;
			this.$emit('input', !this.value);
		}
	}
};
</script>

<style lang="scss" scoped>
.yl-radio {
	width: 32rpx;
	height: 32rpx;
	border-radius: 4rpx;
	border: 2rpx solid #cccccc;
	display: flex;
	align-items: center;
	justify-content: center;
}
.active {
	background-color: #fca118;
	border-color: #fca118;
}
</style>
